package com.hb.game.pk.ui.activity.mine.setting.account;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.hb.game.pk.APP;
import com.hb.game.pk.R;
import com.hb.game.pk.base.BaseActivity;
import com.hb.game.pk.ui.activity.login.ForgetPwdActivity;
import com.hb.game.pk.utils.StringUtils;
import com.hb.game.pk.widgets.MineItemView;
import com.hb.game.pk.widgets.titlebar.TitleBar;

import butterknife.BindView;
import butterknife.OnClick;

public class AccountActivity extends BaseActivity {
    @BindView(R.id.title_bar)
    TitleBar titleBar;
    @BindView(R.id.miv_account)
    MineItemView mivAccount;
    @BindView(R.id.miv_name)
    MineItemView mivName;
    @BindView(R.id.miv_phone)
    MineItemView mivPhone;
    @BindView(R.id.miv_password)
    MineItemView mivPassword;
    @BindView(R.id.miv_pay_password)
    MineItemView mivPayPassword;
    @BindView(R.id.miv_reset_pay_password)
    MineItemView mivResetPayPassword;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_account;
    }

    @Override
    protected int getRootViewId() {
        return R.id.layout_root;
    }

    @Override
    protected int getRefreshId() {
        return 0;
    }

    @Override
    protected int getListViewId() {
        return 0;
    }

    @Override
    protected void initView(Bundle savedInstanceState) {
        super.initView(savedInstanceState);
        titleBar.getLlLeft().setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                AccountActivity.this.finish();
            }
        });

        mivAccount.setRightText(APP.userInfo.getAccount());
        if (!StringUtils.isEmpty(APP.userInfo.getName()))
            mivName.setRightText(APP.userInfo.getName());
        mivPhone.setRightText(APP.userInfo.getMobile());
    }

    @OnClick({R.id.miv_account, R.id.miv_name, R.id.miv_phone, R.id.miv_password, R.id.miv_pay_password, R.id.miv_reset_pay_password})
    public void onViewClicked(View view) {
        Intent intent = new Intent();
        switch (view.getId()) {
            case R.id.miv_account:
                break;
            case R.id.miv_name:
                break;
            case R.id.miv_phone:
                break;
            case R.id.miv_password:
                startActivity(ForgetPwdActivity.class);
                break;
            case R.id.miv_pay_password:
                intent.putExtra("type", 1);
                startActivity(VerifyCodeActivity.class, intent);
                break;
            case R.id.miv_reset_pay_password:
                intent.putExtra("type", 2);
                startActivity(VerifyCodeActivity.class, intent);
                break;
        }
    }
}
